package network;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.mxgraph.util.mxUtils;

/**
 * 
 * @author zhangzuoqiang
 * <br/>Date: Aug 25, 2011
 */
public class NetNode {
	
	// 这里的key是唯一标示，绑定业务对象，松耦合
	private Element adapter;

	public NetNode(String text) {
		Document doc = mxUtils.createDocument();
		adapter = doc.createElement("NetNode");
		setText(text);
	}

	public Element getElement() {
		return adapter;
	}

	public String getKey() {
		return adapter.getAttribute("key");
	}

	public void setKey(String key) {
		adapter.setAttribute("key", key);
	}

	public String getText() {
		return adapter.getAttribute("text");
	}

	public void setText(String text) {
		adapter.setAttribute("text", text);
	}
}